<?php

namespace app\common\validate;

use think\Validate;

class AgentDeliveryMoneyRunning extends Validate
{
	protected $rule = [
		"km" => "require|unique:agent_delivery_money_buy",
		"money" => "require|gt:0",
		"distribution_time" => "require|number|gt:0",
		"agent_id" => "require",
		"catty" => "require|number|gt:0",
	];

	protected $message = [
		"km.require" => "请输公里数",
		"km.number" => "公里数必须要是数字",
		"km.gt" => "公里数数必须大于0",
		"km.unique" => "该公里数已经存在", 

		"money.require" => "请输每公里价格",
		"money.gt" => "每公里价格数必须大于0",

		"distribution_time.require" => "请输每公里配送时间",
		"distribution_time.number" => "每公里配送时间必须要是数字",
		"distribution_time.gt" => "每公里配送时间数必须大于0",

		"catty.require" => "请输每公斤价格",
		"catty.number" => "每公斤价格必须要是数字",
		"catty.gt" => "每公斤价格数必须大于0",

		"agent_id.require" => "请选择代理商",
	];
	protected $scene = [
		'add' => ['km','money','distribution_time','agent_id','catty'],
		'edit' => ['money','distribution_time','agent_id','catty'],
	];
}
